import http from "./request";

// home/brand/list
// 查询推荐品牌
export const homeBrandList = (
  params: IBrandListParams
): PRES<IBrandListModel> => http.get("home/brand/list", { params });

// home/brand/update/sort/{id}
// 修改推荐品牌排序
export const updateSort = (id: number, sort: number): PRES<IReqSort> =>
  http.post(`home/brand/update/sort/${id}?sort=${sort}`);

//   home/brand/delete
// 批量删除推荐品牌
export const brandDelete = (ids: number[]): PRES<IReqSort> =>
  http.post(`home/brand/delete?ids=${ids}`);

// home/brand/update/recommendStatus
// 批量修改推荐品牌状态
export const brandUpdateRecStatus = (
  ids: number[],
  recommendStatus: number
): PRES<IReqSort> =>
  http.post(
    `home/brand/update/recommendStatus?ids=${ids}&recommendStatus=${recommendStatus}`
  );

// brand/list
// 根据品牌名称分页获取品牌列表----------------------------------
export const mallAdminBrand = (
  params?: IAdminBrandListParams
): PRES<IBrandListModel> => http.get(`brand/list`, { params });

//   brand/create
// 添加品牌
export const brandCreate = (params: IBrandCreate[]): PRES<IReqSort> =>
  http.post(`home/brand/create`, params);
